package com.blockchain.front.servlets.trading.ajax;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.framework.service.ServiceSession;
import com.blockchain.front.service.trading.TradingManage;
import com.blockchain.front.servlets.trading.AbstractTradingServlet;

public class JymmExists extends AbstractTradingServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected boolean mustAuthenticated() {
		return false;
	}

	@Override
	protected void processGet(HttpServletRequest request, HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		processPost(request, response, serviceSession);
	}

	@Override
	protected void processPost(HttpServletRequest request, HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		response.setContentType("text/html;charset=" + getResourceProvider().getCharset());
		PrintWriter out = response.getWriter();
		String jymm=request.getParameter("jymm");
		TradingManage tradingManage = serviceSession.getService(TradingManage.class);
		if (!tradingManage.Jymm(jymm)) {
			out.write("交易密码错误。");
		}else{
			out.write("1");	
		}
		
	}

}
